import {
  setToken,
  getToken
} from '@/libs/util'

export default {
  state: {

    property:[],//分类
    propertyArr:[],//选中的分类
    deliver_fee:5,
    self_mention_fee:null,
    self_mention_list:[],
    deliver_option:[],
    prodGroupBasicObj: {
      deliver_fee:null,
      property_id:null,
      cover_image:'',
      cover_image_file_name:'',
      cover_image_type:'',
      album_image:'',
      album_imageArr:[],
      video_url:'',//视频
      remark:'',
      name:'',
      cash:null,
      period_use_day:null,
      pattern:0,//默认单规格
      normsValueSingle:[
        {
        cover_image: '', //封面
        name:'', //规格名称
        price: 0, //周期价格
        cost: 0, //成本
        number: 0,// 库存
        sale_count: 0,//虚拟销量
        src: '',
        norms_ids: 0,
        package_price:0,
        package_day:0
       }
      ],
      normsValue: [
        {
        cover_image: '', //封面
        name:'', //规格名称
        price: 0, //周期价格
        cost: 0, //成本
        number: 0,// 库存
        sale_count: 0,//虚拟销量
        src: '',
        norms_ids: 0,
        package_price:0,
        package_day:0
       }
      ]
    },
    prodGroupSeoObj: {},//seo
    prodGroupGoodsDetailObj:'',//宝贝详情
    prodGroupRentNeedKnowObj:'',//门店须知
    prodGroupRentStepObj:'',//门店须知
    devState:{},
    // 规格模板
    productNormstemplateObj:{
      template_norms_property_id:'',
      template_norms_property_name:'',//仅用于显示
      name:'',
      is_norms:0,
      norms:[
       { property_name:'',
        property_id:'',
        property_value_name:'',
        property_value_id:''}
      ]


    }

  },
  mutations: {


    setVuxproperty(state,arr){
      state.property=arr
    },
    setVuxPropertyArr(state,arr){
      state.propertyArr=arr
    },
    setDevState(state,obj){
      state.devState=obj
    },
    setProdGroupRentNeedKnowObj(state,obj){
      state.prodGroupRentNeedKnowObj=obj
    },

    setUserId(state, id) {
      state.userId = id
    },
    setVuexProdGroupSeoObj(state,obj){
      state.prodGroupSeoObj=obj
    },
    setProdGroupBasicObj(state,obj){
       state.prodGroupBasicObj =obj
    },
    setProdGroupNormsValue(state,arr){
      state.prodGroupBasicObj.normsValue=arr
    },
    setProdGroupNormsValueSingle(state,arr){
      state.prodGroupBasicObj.normsValueSingle=arr
    },
    resetProdGroupDetail(state,str){
      state.prodGroupGoodsDetailObj=str
      state.prodGroupRentNeedKnowObj=str
      state.prodGroupRentStepObj=str
    },
    setProdGroupGoodsDetailObj(state,obj){
      // 宝贝详情
       state.prodGroupGoodsDetailObj=obj
    },
    setProductNormstemplateObj(state,obj){
      state.productNormstemplateObj=obj
    },
    setProductNormstemplateNorms(state,arr){
      state.productNormstemplateObj.norms=arr
    },

  },
  getters: {

  },
  actions: {

  }
}
